Skip to content

Feature/particle graph - #116

Merged
mattvb91 merged 7 commits into
devfrom
feature/particle-graph
Dec 1, 2026
Merged

mattvb91 merged 7 commits into
devfrom
feature/particle-graph

Conversation

@mattvb91

@mattvb91 mattvb91 commented Dec 1, 2026

Copy link
Copy Markdown
Member

No description provided.

Particle effects become scene objects that logic graphs and code control:

- ParticleEffect scene object (props: effect, playing, wind) in a group of
  its own that the editor and graphs move; dropping an effect from Assets
  places one, so it is saved with the scene
- Effects and emitters get play(), stop(clear), burst(count) and alive;
  the state also reaches emitters added later
- Particles graph nodes (client only): Spawn Effect, Play / Stop / Burst /
  Remove Effect, Effect State, On Effect Finished. An empty Effect input is
  Self. Nodes reach effects through a ParticleHost, given to them with the
  new `services` of the graph runtime
- Properties panel: a looping preview and Play / Stop / Burst buttons
  (new `buttons` and `particlePreview` fields)
- Logic graph editor: a preview pane running the graph in a world of its own
  (GraphPreview), restarted on every change, with a pick for Self, Restart,
  Send Message and keys going to the graph
- Particles move with a Wind prefab in the scene (Emitter.windVelocity(),
  windInfluence per emitter, a wind switch per effect)

Fixes in the particle system:

- Smoke puffs never grew: their scales were never flagged for upload
- Smoke drew a fixed number of pixels per puff, small up close and huge from
  afar; puffs now have a size in the world
- Smoke never showed without a smokeTexture resource; it falls back to a
  soft disc. A Smoke removed before its texture loaded no longer creates its
  emitter afterwards
- Rain and Smoke now register outside the editor too, so a saved scene's
  effects load in a game
- Emitters were disposed twice; the base update flags alphas too
- The editor's effect auto-import skips tests and build output
- PooledEmitter: a CPU emitter over a pool of particles, let out at a rate,
  in repeated bursts or by burst(); each moves with its velocity, gravity,
  drag and the wind, can bounce off the ground, and changes size, color and
  opacity over its life. Subclasses only say where a particle starts and how
  fast it goes
- Fire (flames and embers), Sparks, Dust Puff and Explosion (flash,
  fireball, sparks and smoke, burst scaled per part) on it; Snow falls
  through a box on the GPU like Rain, swaying and blown by the wind
- particleShapes: the world-size factor for attenuated points (Smoke uses
  it too) and a soft round dot
- Effects can register an icon for the asset list; Smoke and Rain carry
  theirs instead of the editor special-casing Rain
- The asset preview plays the whole effect, not only its first emitter
- The editor's effect auto-import also finds classes extending any
  emitter (not EventEmitter)
usesParticleNodes(graph) finds a node of the Particles category, the
engine's or a plugin's; the graph editor shows the preview pane for those
logic graphs only.
- PooledEmitter particles with a bounce cast their step through the
  client's physics world, where terrains, primitives and scatter layers
  already keep their colliders: they bounce off the surface they hit along
  its normal, lose `friction` along it and come to rest. One starting
  inside a collider passes through rather than sticking. Without a physics
  world, or with collideWithScene off (the editor's previews), they bounce
  off the emitter's own ground as before
- `fadeOut`: the part of a particle's life it fades out over
- Debris: rocks and dirt thrown up, bouncing and rolling to a stop. Sparks
  (and the Explosion's) now hit the scene too
- Particle effects get a `collider` option (scene object prop, Properties
  checkbox, Spawn Effect input, collideWithScene in code), off by default:
  only with it on do bouncing and settling particles cast rays through the
  physics world; otherwise they use the effect's own flat ground and make
  no physics checks at all
- PooledEmitter: `stick` (stays where it lands; landed particles neither
  move nor cast rays), `restFor` (how long it lies there), `steer()` for
  extra forces, `sizeVariation`, and the current wind for subclasses
- Snow is a pooled emitter now: flakes sway, blow, start upwind and settle
  where they land for 8 to 15 s before melting; the sky starts full
- The physics debug view draws where particles hit colliders, as short
  lines along the surface normal: particles aren't in the physics world,
  so Rapier had nothing of theirs to draw
- ctx.registerParticle(name, entry) in client plugins: the effect goes by
  `<package>:<name>` in scene files and graphs (returned), and the editor
  shows its label with the plugin's name wherever an effect is picked.
  Documented in the CLI README with a PooledEmitter example
- Particle effects get an `aroundCamera` option (scene object prop,
  Properties checkbox, code): new particles start around the camera,
  sideways, rather than the emitter, and those already out stay where
  they are. Rain centres its box of drops on the camera, wrapping drops
  past its edge
- Snow covers 40 m instead of 24, as dense as before
@mattvb91
mattvb91 merged commit 3cfec25 into dev Dec 1, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant